package com.zyx.xxl.executor.domain.resp;

import com.zyx.xxl.executor.domain.enums.ResultCodeEnum;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author Yaxi.Zhang
 * @since 2022/6/13 18:39
 */
@Data
@Accessors(chain = true)
public class FrontResult {
    private Integer code;
    private String msg;

    public static FrontResult getExceptionResult(Integer code, String msg) {
        return new FrontResult().setCode(code).setMsg(msg);
    }

    public static FrontResult getSuccessResult(String pre, String msg) {
        return new FrontResult().setCode(ResultCodeEnum.SUCCESS.getCode()).setMsg(pre + msg);
    }

}
